package Test;

/**
 * @BelongsProject: LeetCode
 * @BelongsPackage: Test
 * @Author: song
 * @CreateTime: 2022-09-22  02:55
 * @Description: 抽象工厂
 * @Version: 1.0
 */

public class test {
    public static void main(String[] args) {
        x1Factory x1Factory = new x1Factory();
        IbmwCar x1 = x1Factory.createCar();
        x1.run();
        x1.logo();
    }
}

class x1Car implements IbmwCar{

    @Override
    public void run() {
        System.out.println("x1正在生产中...");
    }

    @Override
    public void logo() {
        System.out.println("x1的logo正在生产中...");
    }
}


class x1Factory implements IbmwFactory{


    @Override
    public IbmwCar createCar() {
        return new x1Car();
    }

}

interface IbmwCar{
    void run();
    void logo();
}

interface IbmwFactory{
    IbmwCar createCar();
}
